/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XPF
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface ExercisePrescriptionTrigger extends BasicModel<ExercisePrescriptionTrigger> {
  triggerId?: string; // 触发主键
  triggerType?: string; // 规则类型（体测成绩、体育成绩）
  triggerScore1?: string; // 警戒分值1
  prescriptionId?: string; // 运动处方
  triggerScore2?: string; // 警戒分值2
  scoreSymbol?: string; // 分值符号“等与、小于等于、大于等于”
  evaluationCheckTerm?: string; // 项名称（测评/考核）
}

export const exercisePrescriptionTriggerList = (params?: ExercisePrescriptionTrigger | any) =>
  defHttp.get<ExercisePrescriptionTrigger>({
    url: adminPath + '/physical/exercisePrescriptionTrigger/list',
    params,
  });

export const exercisePrescriptionTriggerListData = (params?: ExercisePrescriptionTrigger | any) =>
  defHttp.post<Page<ExercisePrescriptionTrigger>>({
    url: adminPath + '/physical/exercisePrescriptionTrigger/listData',
    params,
  });

export const exercisePrescriptionTriggerForm = (params?: ExercisePrescriptionTrigger | any) =>
  defHttp.get<ExercisePrescriptionTrigger>({
    url: adminPath + '/physical/exercisePrescriptionTrigger/form',
    params,
  });

export const exercisePrescriptionTriggerSave = (
  params?: any,
  data?: ExercisePrescriptionTrigger | any,
) =>
  defHttp.postJson<ExercisePrescriptionTrigger>({
    url: adminPath + '/physical/exercisePrescriptionTrigger/save',
    params,
    data,
  });

export const exercisePrescriptionTriggerDelete = (params?: ExercisePrescriptionTrigger | any) =>
  defHttp.get<ExercisePrescriptionTrigger>({
    url: adminPath + '/physical/exercisePrescriptionTrigger/delete',
    params,
  });

export const exercisePrescriptionSelectData = (params?: ExercisePrescriptionTrigger | any) =>
  defHttp.post<Page<ExercisePrescriptionTrigger>>({
    url: adminPath + '/physical/exercisePrescription/selectData',
    params,
  });

export const sportsPhysicalSkillsSelectDataByPrescription = (
  params?: ExercisePrescriptionTrigger | any,
) =>
  defHttp.post<Page<ExercisePrescriptionTrigger>>({
    url: adminPath + '/physical/sportsPhysicalSkills/selectDataByPrescriptionId',
    params,
  });

export const sportsWeightSelectDataByPrescriptionId = (
  params?: ExercisePrescriptionTrigger | any,
) =>
  defHttp.post<Page<ExercisePrescriptionTrigger>>({
    url: adminPath + '/sports/sportsWeight/selectDataByPrescriptionId',
    params,
  });
